package com.gxar.file.server.base.model.upload.request;

import com.alibaba.fastjson2.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author linsy
 * @version 1.0
 * @created 2023/8/14 10:42
 */
@Data
@ApiModel("分片文件上传请求")
public class FilePartUploadRequest {

    @ApiModelProperty("文件传输任务ID 文件MD5编码")
    @JSONField(name = "identifier")
    private String identifier;

    @ApiModelProperty("分片总数")
    @JSONField(name = "total_chunks")
    @NotNull(message = "分片总数不能为空")
    private Integer totalChunks;

    @ApiModelProperty("每个分块的大小。最小(1024*1024*5)")
    @JSONField(name = "chunk_size")
    @NotNull(message = "分块大小不能为空")
    private Long chunkSize;

    @ApiModelProperty("当前为第几分片")
    @JSONField(name = "chunk_number")
    @NotNull(message = "当前分片不能为空")
    private Integer chunkNumber;

    @ApiModelProperty("oss上传时的上传id")
    @JSONField(name = "upload_id")
    private String uploadId;

    @ApiModelProperty("oss上传时的文件key")
    @JSONField(name = "key")
    private String key;

    @ApiModelProperty(value = "上传的产品名称", allowableValues = "material-素材")
    @NotNull(message = "产品名称不能为空")
    private String product;

    @ApiModelProperty(value = "是否公共读,默认false")
    private Boolean publics;

    @ApiModelProperty(value = "自定义目录")
    private String directory;
}
